package model

import "time"

// Excel 导入
type Stu struct {
	Name         string `header:"姓名" is_header:"true" write:"true"`
	Sno          string `header:"学号" is_header:"true" write:"true"`
	Phone        string `header:"手机号" is_header:"true" write:"true"`
	Academy      string `header:"学院" is_header:"true" write:"true"`
	Profession   string `header:"专业" is_header:"true" write:"true"`
	Education    string `header:"学历" is_header:"true" write:"true"`
	Grade        string `header:"年级" is_header:"true" write:"true"`
	ErrInfo      string `header:"错误信息" is_header:"false" write:"true"`
	ConstituteID uint   `header:"关联id" is_header:"false" write:"false"`
}

type ImportResp struct {
	Sum      int    `json:"sum"`
	SucNum   int    `json:"suc_num"`
	ErrNum   int    `json:"err_num"`
	ErrorUrl string `json:"error_url"`
}

type AddStudentRequest struct {
	Id           int    `json:"id" form:"id" uri:"id"`
	Name         string `json:"name" form:"name" binding:"required"`
	Phone        string `json:"phone" form:"phone"`
	Sno          string `json:"sno" form:"sno"`
	Education    string `json:"education" form:"education"`
	Grade        string `json:"grade" form:"grade"`
	ConstituteId uint   `json:"constitute_id" form:"consitute_id"`
}

type UpdateStudentRequest struct {
	Id            int    `json:"id" form:"id" uri:"id"`
	Name          string `json:"name" form:"name" binding:"required"`
	Phone         string `json:"phone" form:"phone" bind:"required"`
	Education     string `json:"education" form:"education"`
	Grade         string `json:"grade" form:"grade"`
	Sno           string `json:"sno" form:"sno"`
	ConstituteId  uint   `json:"constitute_id" form:"consitute_id"`
	CanUseApplets *bool  `json:"can_use_applets" form:"can_use_applets"`
}

type GetStudentRequest struct {
	Page         int        `json:"page" form:"page"`
	PageSize     int        `json:"page_size" form:"page_size"`
	ConstituteId uint       `json:"constitute_id"`
	Query        string     `json:"query" form:"query"`
	Academy      int        `json:"academy" form:"academy"`
	School       int        `json:"school" form:"school"`
	Profession   int        `json:"profession" form:"profession"`
	Grade        string     `json:"grade" form:"grade"`
	Education    string     `json:"education" form:"education"`
	TrainSort    string     `json:"train_sort" form:"train_sort"`
	StartTime    *time.Time `form:"start_time" time_format:"2006-01-02 15:04:05"`
	EndTime      *time.Time `form:"end_time" time_format:"2006-01-02 15:04:05"`
}

type GetStudentYRequest struct {
	Page         int    `json:"page" form:"page"`
	PageSize     int    `json:"page_size" form:"page_size"`
	Query        string `json:"query" form:"query"`
	MemberStatus int    `json:"member_status" form:"member_status"`
	MemberType   int    `json:"member_type" form:"member_type"`
	TrainSort    string `json:"train_sort" form:"train_sort"`
}

type DeleteStudentRequest struct {
	Id int `json:"id" form:"id" binding:"required" uri:"id"`
}

type ResetStudentPwdRequest struct {
	Id     int    `json:"id" form:"id" binding:"required" uri:"id"`
	School string `json:"school" form:"school" binding:"required" uri:"school"`
	Sno    string `json:"sno" form:"sno" binding:"required" uri:"sno"`
}

// 定义响应数据
type StudentResp struct {
	Id              uint        `json:"id"`
	Name            string      `json:"name"`
	School          string      `json:"school"`
	Academy         string      `json:"academy"`
	Profession      string      `json:"profession"`
	Grade           string      `json:"grade"`
	Phone           string      `json:"phone"`
	TrainCount      uint        `json:"train_count"`
	Education       string      `json:"education"`
	ConstituteId    uint        `json:"constitute_id"`
	Sno             string      `json:"sno"`
	MemberStartTime string      `json:"member_start_time"`
	MemberStatus    bool        `json:"member_status"`
	MemberTitle     string      `json:"member_title"`
	MemberExpire    string      `json:"member_expire"`
	SurplusTime     int         `json:"surplus_time"`
	Member          *UserMember `json:"member"`
	CanUseApplets   bool        `json:"can_use_applets"`
}
